<script type="text/javascript">
$(function () {
	addFilesUploadEvent_data();
}); 
jQuery(function($) {
	var $liveTip = $('<div id="livetip"></div>').hide().appendTo('body');
	var tipTitle = '';
	
	$('#mytable').bind('mouseover mouseout mousemove', function(event) {
	  var $link = $(event.target).closest('a');
	  if (!$link.length) { return; }
	  var link = $link[0];
	
	  if (event.type == 'mouseover' || event.type == 'mousemove') {
		$liveTip.css({
		  top: event.pageY + 12,
		  left: event.pageX + 12
		});
	  };
	
	  if (event.type == 'mouseover') {
		tipTitle = link.title;
		link.title = '';
		$liveTip.html('<div>' + tipTitle + '</div><div>' + link.href + '</div>')
			.show();
	  };
	
	  if (event.type == 'mouseout') {
		$liveTip.hide();
		if (tipTitle) {
			link.title = tipTitle;
		};
	  };
	});
});
$('#editDataForm').find("input:checkbox, input:radio").not('input.ibtn').uniform();
</script>
<#import "/freemarker/modeltype.ftl" as mt>
<#import "/freemarker/modeltype_entity.ftl" as mte>
<div>
	<h4 class="title"><i class="fontello-icon-th-list-1"></i> 编辑资料信息</h4>
</div>
<div class="widget" >
	<div class="widget-content">
		<form id="editDataForm" style="width: 400px;">
			<label>所属课程<a href="javascript:;" style="color: blue;" onclick="javascript: selectCourse_data();">[选择]</a><input type="hidden"/></label>
			<table class="table table-bordered">
				<thead>
					<tr>
						<th>课程名称 </th>
						<th style="width:30px;">操作 </th>
					</tr>
				</thead>
				<tbody id="sskc">
					<#if tm?? && tm.cmrList??>
						<#assign c = 0 />
						<#list tm.cmrList as cmr>
						<tr class="footable-even" style="display: table-row;">
							<td>${(cmr.cn)!''}</td>
							<td>
								<input type="hidden" class="cc" name="cmrList[${c}].cc" value="${(cmr.cc)!''}" />
								<button class="btn btn-xs btn-danger" onclick="javascript: deletedCourses_data($(this)); return false;" title="删除">
									<i class="icon-remove"></i>
								</button>
							</td>
						</tr>
						<#assign c = c + 1 />
						</#list>
					</#if>
				</tbody>
			</table>
			<table style="width:500px;"  class="table table-bordered">
				<tr>
					<td>资料名称</td>
					<td><input id="name" type="text" name="name" value="${(tm.name)!''}" />
						<input type="hidden" name="code" value="${(tm.code)!''}" />
					</td>
				</tr>
				<tr>
					<td>备注</td>
					<td>
						<textarea type="textarea" id="remark" name="remark" rows="3">${(tm.remark)!''}</textarea>
					</td>
				</tr>
				<tr id="bar" class="form-group" style="display: none;">
					<td>上传中...</td>
					<td>
						<span id='percent'>0%</span><div id="show" style="border:3px solid #000;background-color:yellow;width: 180px;" ></div>
					</td>
				</tr>
				<tr>
					<td>附件<a id="uploadFilesBtn" style="color: blue;" href="javascript:;">[选择]</a><a style="color: red;" title="请把所有文件都转成PDF格式再上传，Word、PPT、excel可直接点击另存为PDF格式，其他的文件格式请转为这三种类型后再转成PDF格式，可以更好的记录学员的学习情况！">提示</a></td>
					<td>
						<div class="col-sm-10" id="annexListTd">
						<#assign i = 0 />
							<#if tm?? && tm.list??>
							<#list tm.list as tma>
								<div class="filter-table rep" style="margin-left:5px; margin-bottom:0px;">
									<input type="hidden" name="list[${tma_index}].code" value="${tma.code}" />
									<button type="button" class="close" data-dismiss="alert" onclick="javascript:deleteSelectedItem_data($(this));">&times;</button>
									<a class="title" target="_blank" href="${contextPath}upload/data/${tma.sn}">${tma.name}</a>
								</div>
							<#assign i = i + 1 />
							</#list>
							</#if>
						</div>
					</td>
				</tr>
				<tr>
					<td style="text-align: center;" colspan="3">
						<a class="btn btn-info" onclick="javascript: save_data(); return false;"  title="保存" ><i class="icon-save"></i>&nbsp;&nbsp;保存</a>&nbsp;&nbsp;&nbsp;
						<a class="btn btn-primary" onclick="javascript: sys_load_handle('data'); return false;" title="取消">取消</a>
					</td>
				</tr>
			</table>
			
		</form>
	</div>
</div>
<input type="hidden" id="tm_annex_index" value="${i}" />
<div id="tempAnnexListDiv" style="display:none;">
	<div class="filter-table rep" style="margin-left:5px; margin-bottom:0px;">
		<input class="name" type="hidden" />
		<input class="size" type="hidden" />
		<input class="sn" type="hidden"  />
		<input class="ext" type="hidden"  />
		<input class="afcs" type="hidden" name="afcs" />
		<button type="button" class="close" data-dismiss="alert" onclick="javascript:deleteSelectedItem_data($(this));">&times;</button>
		<a class="title" href="javascript:;"></a>
	</div>
</div>